<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<%@ page contentType="text/html; charset=utf-8"%>
	<%@ include file="/commons/taglibs.jsp"%>

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
		<title>用户管理</title>

		<%@ include file="/commons/css_js_head.jsp"%>
		<script type="text/javascript">
//复写Url
doListUrl = "${ctx }/base/tsUserAction!doList.ts";
doAddBeforeUrl = "${ctx }/base/tsUserAction!doFindById.ts";
doUpdateBeforeUrl = "${ctx }/base/tsUserAction!doFindById.ts";
doDelUrl = "${ctx }/base/tsUserAction!doDelete.ts"
//添加之前
function doAddBefore() {
	var _form = document.forms[0];
	if (doAddBeforeUrl == '') {
		alert('请设置正确的URL!');
		return false;
	}

	_form.action = doAddBeforeUrl;
	_form.submit();
}

//更新之前 
function doUpdateBefore(pkId) {
	var _form = document.forms[0];
	if (doUpdateBeforeUrl == '') {
		alert('请设置正确的URL!');
		return false;
	}

	//_form.action = doUpdateBeforeUrl + "?userId=" + pkId;
	//_form.submit();
	tb_show("update","${ctx }/base/tsUserAction!doFindById.ts?userId=" + pkId+"&keepThis=true&TB_iframe=true&width=600&height=400&modal=true",false);
}

//删除
function doDel(pkId) {
	var _form = document.forms[0];
	if (doDelUrl == '') {
		alert('请设置正确的URL!');
		return false;
	}
		if(confirm("确定删除?"))
		{
				_form.action = doDelUrl + "?userId=" + pkId;
				_form.submit();
		}
	
}



</script>


	</head>
	<body style="overflow-x: hidden" >

		<!-- 标题 -->
		<div class="mTitle">
			<span class="hidsearch"><a href="javascript:void(0)"
				onClick="return chg('searchList');" id="ImgArrow"> <img
						src="${ctx}/images/icon_up.gif" id="imgButton" />
			</a> </span>
			<b class="bbig">用户管理</b>
			<a href="javascript:void(0)" onclick="javascript:doAddBefore();" >增加用户</a>
		</div>

		<!--list -->
		<div class="searchBar" id="searchList" style="display: block;">
			<form action="/base/tsUserAction!doList" method="post">
				<table class="searchTable">
					<tr>
						<th>
							用户名称：
						</th>
						<td>
							<s:textfield name="userName" theme="simple"></s:textfield>
						</td>
						
						
						
						<td>
							<input name="btn_query" type="button" class="btn" value="查询"
								onclick="doQuery()" />
							
						</td>
					</tr>
				</table>
			</form>
		</div>
		<div class="mainList">

			<table class="listTable">
				<tr>
					<th>序号</th>
					<th>
						用户名称
					</th>
					
					<th>
						创建日期
					</th>
					<th>
						公司
					</th>
					<th>
						安装地址
					</th>
					
					<th>
						备注
					</th>
					<th>
						操作
					</th>
				</tr>

				<c:forEach var="user" varStatus="status" items="${pager.data}">
					<tr align=center>
						<td>${status.index+1} </td>
						<td>
							${user.userName}
						</td>
						
						<td>
						<fmt:formatDate value="${user.createDate }" type="date" dateStyle="default"/> 
							
						</td>
						<td>
							${user.company}
						</td>
						<td>
							${user.address}
						</td>
						<td>
						${user.remark}
						</td>
						
						<td>
							<a href="javascript:void(0)"
								onclick="javascript:doUpdateBefore('${user.uiid}');"><span
								class="icon_edit">&nbsp;</span>修改</a>
							<a href="javascript:void(0)" onclick="javascript:doDel('${user.uiid}');"><span
								class="icon_del">&nbsp;</span>删除</a>
							
						</td>
					</tr>
				</c:forEach>
			</table>
		</div>
		<!--end list -->

		<!-- 分页区域  -->
<%@ include file="/page/pager.jsp"%>

<script type="text/javascript">
ajaxAnywhere.formName = "form1";
ajaxAnywhere.getZonesToReload = function() {
    return "zoneList";
}
</script>

	</body>
</html>
